<template>
	<el-form  :model="bedform" label-width="80px">
	
		<el-form-item label="序号">
			<el-input v-model="bedform.patientId"></el-input>
		</el-form-item>
		<el-form-item label="床位号">
			<el-input v-model="bedform.bedId"></el-input>
		</el-form-item>
		<el-form-item label="房间号">
			<el-input v-model="bedform.houseId"></el-input>
		</el-form-item>
		
		<el-form-item label="起始日期">
			<el-date-picker
			  v-model="bedform.startdate"
			  type="date"
			  format="yyyy-MM-dd"
			 value-format="yyyy-MM-dd" 
			  placeholder="选择日期">
			</el-date-picker>
		</el-form-item>
		<el-form-item label="结束日期">
			<el-date-picker
			  v-model="bedform.enddate"
			  type="date"
			  format="yyyy-MM-dd"
			  value-format="yyyy-MM-dd" 
			  placeholder="选择日期">
			</el-date-picker>
		</el-form-item>
		<el-form-item label="床位详细信息">
			<el-input v-model="bedform.content"></el-input>
		</el-form-item>
		<el-button type="primary" @click="doAdd">提交</el-button>
	</el-form>
</template>

<script>
	
	export default{
		name:'Add',
		props:[
			'dialogVisible',
			
		],
		data(){
			return {
				bedform:{
					patientId:'',
					bedId:'',
					houseId:'',
					startdate:'',
					enddate:'',
					content:''
				}
			}
		},
		methods:{
			doAdd(){
				this.getRequest("/bed/insert",this.bedform).then(resp=>{
					if(resp){
						this.$emit("update:dialogVisible",false);
						this.$emit("add")
					}else{
						this.$message.error({message:'保存失败'});
					}
				})
			}
		}
	}
</script>

<style>
</style>
